package com.ycky.system.mq.message.sms;

import com.ycky.framework.common.core.KeyValue;
import lombok.Data;

import jakarta.validation.constraints.NotNull;
import java.util.List;

/**
 * 短信发送消息
 */
@Data
public class SmsSendMessage {

    /**
     * 短信日志编号
     */
    @NotNull(message = "短信日志编号不能为空")
    private Long logId;
    /**
     * 手机号
     */
    @NotNull(message = "手机号不能为空")
    private String mobile;
    /**
     * 短信渠道编号
     */
    @NotNull(message = "短信渠道编号不能为空")
    private Long channelId;
    /**
     * 短信 API 的模板编号
     */
    @NotNull(message = "短信 API 的模板编号不能为空")
    private String apiTemplateId;
    /**
     * 短信模板参数
     */
    private List<KeyValue<String, Object>> templateParams;

    // 链式 set 方法
    public SmsSendMessage setLogId(Long logId) {
        this.logId = logId;
        return this;
    }

    public SmsSendMessage setMobile(String mobile) {
        this.mobile = mobile;
        return this;
    }

    public SmsSendMessage setChannelId(Long channelId) {
        this.channelId = channelId;
        return this;
    }

    public SmsSendMessage setApiTemplateId(String apiTemplateId) {
        this.apiTemplateId = apiTemplateId;
        return this;
    }

    public SmsSendMessage setTemplateParams(List<KeyValue<String, Object>> templateParams) {
        this.templateParams = templateParams;
        return this;
    }
}